#include <bits/stdc++.h>
using namespace std;

long long n;
vector<int> ans;

void dfs(int x)
{
	if(x>n)
	{
		for(auto &e:ans)
			cout<<e<<" ";
		cout<<endl;
		return;
	}
	ans.push_back(x);
	dfs(x+1);
	ans.pop_back();
	dfs(x+1);
}


int main()
{
	cin>>n;
	dfs(1);
	return 0;
}
